﻿<!DOCTYPE html>
<html>
<head>
    <title>JS Operators Exercise 3</title>
    <link href="styles/js-console.css" rel="stylesheet" />
</head>
<body>
    <h1>Calculate rectangle's area:</h1>
    <label for="width-number">Width:</label>
    <input type="number" id="width-number"/>
    <label for="height-number">Height:</label>
    <input type="number" id="height-number"/>
    <button onclick="calculate()">Calculate</button>
    <div id="js-console"></div>
    <script src="scripts/js-console.js"></script>
    <script>
        function calculate()
        {
            var regWidth;
            var regHeight;

            regWidth = jsConsole.readInteger("#width-number");
            regHeight = jsConsole.readInteger("#height-number");

            jsConsole.writeLine("rectangle’s area is: " + (regWidth * regHeight));
        }
    </script>
</body>
</html>